<template>
  <div class="webview">
    <iframe id="iframe" name="iframe" class="iframe" :src="webUrl" frameborder="no" scrolling="auto">
      <p>你的浏览器不支持浏览</p>
    </iframe>
  </div>
</template>

<script>
  export default {
    name: "webview",
    data() {
      return {
        webUrl: ''
      }
    },
    created() {
      this.webUrl = this.$route.query.url;
    },
    mounted() {
      var ifreame = window.frames["iframe"];
      if (ifreame != null && ifreame != undefined) {
        var title=ifreame.top.document.title;
        this.$route.meta.title=title;
        console.log(iframe.frames.top.document.title);
      }
    }
  }
</script>

<style scoped lang="scss">
  .webview {
    width: 100%;
    height: 100%;
    position: relative;

    .iframe {
      width: 100%;
      height: 100%;
      overflow: hidden;
      position: absolute;
      top: 0px;
      bottom: 0px;
    }
    .iframe::-webkit-scrollbar {
      width: 0px;
      height: 0px;
      display: none;
    }
  }

</style>
